﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Battle
{
    public class StatusControl
    {
        public class MainPlayer
        {
            private string _PlayerName;
            public string PlayerName
            {
                get { return _PlayerName; }
                set { _PlayerName = value; }
            }
            private Status _PlayerStatus;
            public Status PlayerStatus
            {
                get { return _PlayerStatus; }
                set { _PlayerStatus = value; }
            }
            private DateTime _WarpStamp = new DateTime();
            public DateTime WarpStamp
            {
                get { return _WarpStamp; }
                set { _WarpStamp = value; }
            }
            private ushort _Freq = 8025;
            public ushort Freq
            {
                get { return _Freq; }
                set { _Freq = value; }
            }
        }

        private List<MainPlayer> _MasterList = new List<MainPlayer>();
        public List<MainPlayer> MasterList { get { return _MasterList; } }

        public void PlayerEntered(string PlayerName)
        {
            MainPlayer newp = new MainPlayer();
            newp.PlayerName = PlayerName;
            newp.PlayerStatus = Status.InSpec;
            _MasterList.Add(newp);
        }
        public MainPlayer GetPlayer(string PlayerName)
        {
            MainPlayer reply = null;
            _MasterList.ForEach(delegate(MainPlayer p)
            {
                if (p.PlayerName == PlayerName)
                    reply = p;
            });
            return reply;
        }
    }
}
